<% layout('/layouts/default.html', {title: '评分详情', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<#form:form id="searchForm" model="${dcSupExamInfo}" action="${ctx}/score/dcSupExamDXZBScore/dxScoreStepInfo" method="post" class="form-inline">
			<div style="float: right">
				<#form:hidden path="id"/>
<!--				<div class="form-group">-->
<!--					<label class="control-label">${text('年度')}：</label>-->
<!--					<div class="control-inline width-120">-->
<!--						<#form:select path="examYear" items="${yearList}" blankOption="true" data-placeholder="请选择" itemLabel="yearLabel" itemValue="yearValue" class="form-control width-120" defaultValue="${currentYear}"/>-->
<!--					</div>-->
<!--				</div>-->
				<div class="form-group">
					<label class="control-label">${text('评分单位')}：</label>
					<div class="control-inline width-160">
						<#form:input path="gradeOrgName" maxlength="100" class="form-control width-160" placeholder="请输入评分单位名称"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button onclick="cz();" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</div>
		</#form:form>
	</div>
	<div class="box-body">
		<table id="dataGrid"></table>
	</div>
</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	showRownum: false,
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text("考核任务id")}', name:'examId', index:'a.exam_id',hidden:true},
		{header:'${text("考核年度")}', name:'examYear', index:'a.exam_year', width:50, align:"center"},
		{header:'${text("考核标题")}', name:'examTitle',  width:150, align:"left"},
		{header:'${text("评分单位")}', name:'gradeOrgName',  width:150, align:"left"},
		{header:'${text("考核单位编码")}', name:'gradeOrg',  width:150, align:"left",hidden : true},
		{header:'${text("是否提交评分")}', name:'dxStepStatus', width:70, align:"center", formatter: function(val, obj, row, act){
			if (val=='1'){
				return "<span style=\"color: dodgerblue\">已提交</span>";
			}else {
				return "<span style=\"color: red\">未提交</span>";
			}
		}},
		{header:'${text("操作")}', name:'actions', width:230, align:"center", formatter: function(val, obj, row, act){
			var actions = [];
			// if(row.noticeStatus=='1') {
			// 	actions.push('<a href="${ctx}/notice/dcSupExamNotice/receiveNotice?id=' + row.noticeOrgId +'&noticeType='+row.noticeType+'&noticeId='+row.id +'&examId='+row.examId +'&noticeStatus=2&noticeOrg='+row.noticeOrgs+'"  class="btn btn-primary btn-xs btnList" title="${text("接收")}" data-confirm="${text("确认要接收该通知吗？")}">接收</a>&nbsp;');
			// }else{
			// 	actions.push('<a href="${ctx}/score/dcSupExamDXZBScore/view?&examId=' + row.examId + '&gradeOrg='+row.noticeOrgs+'&noticeId='+row.id +'" class="btn btn-primary btn-xs btnList" title="${text("单项指标评分")}"><span>单项指标评分</span></a>&emsp;');
			// }
				actions.push('<a href="${ctx}/score/dcSupExamDXZBScore/dxOnlyReadView?examId=' + row.examId + '&gradeOrg='+row.gradeOrg+'" class="btn btn-primary btn-xs btnList" title="${text("查看评分")}"><span>查看评分</span></a>&emsp;');
				if(row.dxStepStatus!=1){
					actions.push('<a style="cursor:pointer;" onclick=cuiban("' + row.examId + '","'+row.gradeOrg+'") class="btn btn-primary btn-xs" title="${text("催办")}" ><span>催办</span></a>&nbsp;');
				}else{
					actions.push('<a  href="${ctx}/score/dcSupExamDXZBScore/dxWithdraw?examId=' + row.examId + '&gradeOrg='+row.gradeOrg+'"  class="btn btn-primary btn-xs btnList" title="${text("退回")}" data-confirm="${text("确认要退回此评分单位的评分吗？")}">退回</a>&nbsp;');
				}
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});

function cz(){
	searchForm.reset();
	$('#dataGrid').dataGrid('reloadGrid');
}

function cuiban(id,org){
	js.loading();
	js.layer.open({
		type: 2,
		title: ['催办'],
		area: ['800px', '400px'],
		scrollbar: true,
		shadeClose: false,
		content: "${ctx}/score/dcSupExamDXZBScore/cuibanPageDXCK?id="+id+'&org='+org,
		btn1: function (index, layero) {
		},
		success: function (data) {
			js.closeLoading(0, true);
		},
		end:function () {

		}
	});

}
</script>